package com.examination.mlib.baseold;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;


public abstract class ModuleBaseFragment extends Fragment implements IFragment{

    protected View baseView;


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return baseView = inflater.inflate(bondLayout(),container,false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
        initData();
        initEvent();
    }

//    @Override
//    public void onStart() {
//        super.onStart();
//        initData();
//    }




    public<T extends View> T findViewById(@IdRes int id){
        return baseView.findViewById(id);
    }


}
interface IFragment {
    int bondLayout();
    void initView();
    void initData();
    void initEvent();

}
